DROP TABLE IF EXISTS jms_dwd.dwd_barscan_warehousing_dt ;
CREATE EXTERNAL TABLE jms_dwd.dwd_barscan_warehousing_dt (
billcode            string        comment  '运单编号' ,                     --nvarchar2(20)
scansitecode_later            string        comment  '扫描网点编号' ,                     --nvarchar2(20)
scantime_later            timestamp        comment  '扫描时间' ,                     --date
inputtime_later            timestamp        comment  '录入时间' ,                     --date
nextstationcode_later            string        comment  '上下一站编号' ,                     --nvarchar2(20)
scanuser_later            string        comment  '扫描雇员' ,                     --nvarchar2(30)
scanusercode_later            string        comment  '扫描雇员' ,                     --nvarchar2(30)
weight_later            decimal(10, 2)        comment  '重量' ,                     --number(10,2)
packagecode_later            string        comment  '所属袋号' ,                     --nvarchar2(20)

scansitecode_early            string        comment  '扫描网点编号' ,                     --nvarchar2(20)
scantime_early            timestamp        comment  '扫描时间' ,                     --date
inputtime_early            timestamp        comment  '录入时间' ,                     --date
nextstationcode_early            string        comment  '上下一站编号' ,                     --nvarchar2(20)
scanuser_early            string        comment  '扫描雇员' ,                     --nvarchar2(30)
scanusercode_early            string        comment  '扫描雇员' ,                     --nvarchar2(30)
weight_early            decimal(10, 2)        comment  '重量' ,                     --number(10,2)
packagecode_early            string        comment  '所属袋号',                      --nvarchar2(20)

sendcustomer           string        comment  '寄件客户'                    --NVARCHAR2(60) -- 多次扫描都不会变化
)
    COMMENT '入仓去重表'
    PARTITIONED BY (
         dimtype  STRING COMMENT '去重维度:billcode为运单维度去重;bill_scansite为运单加网点维度去重;',
         dt         STRING COMMENT '更新日期 (yyyy-MM-dd)')
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dwd.db/external/dwd_barscan_warehousing_dt'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );

MSCK REPAIR TABLE jms_dwd.dwd_barscan_warehousing_dt;
